home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM BV3 / BMUG PD-ROM Version BV3 (CDRM1097900).iso / HyperCard / Games / HyperArchy / HyperArchy / background_2605.txt < prev    next >
Text File  |  1990-02-11  |  12KB  |  547 lines

  1. -- background: 2605 from stack: in
  2. -- bmap block id: 3303
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on newCard
  8.  
  9.   global childStackName, parentStackName, parentName, parentID, selfName, selfID
  10.  
  11.   set cursor to watch
  12.  
  13.  
  14.   put field "Child Stack Name" of first card into field "Child Stack Name" of this card
  15.   put parentStackName into field "Parent Stack Name"
  16.   put parentName into field "Parent Name"
  17.   put parentID into field "Parent ID"
  18.   put empty into field "Child IDs"
  19.   put short id of this card into field "Self ID"
  20.  
  21.   -- tell the parent about new child
  22.   put field "Parent ID" into parentID
  23.   put field "Parent Stack Name" into parentStackName
  24.   if parentID is not empty then
  25.     put short id of this card into selfID
  26.     push card
  27.     go to card ID parentID of stack parentStackName
  28.     put selfID & return after field "Child IDs"
  29.     pop card
  30.   end if
  31.  
  32.   pass newCard
  33. end newCard
  34.  
  35. on doMenu text
  36.   if text is "New Stack..." or text is "Copy Card" or text is "Cut Card" then
  37.     beep
  38.     exit doMenu
  39.   end if
  40.   pass doMenu
  41. end doMenu
  42.  
  43.  
  44.  
  45. -- part 47 (field)
  46. -- low flags: 81
  47. -- high flags: 0002
  48. -- rect: left=76 top=21 right=42 bottom=500
  49. -- title width / last selected line: 0
  50. -- icon id / first selected line: 0 / 0
  51. -- text alignment: 0
  52. -- font id: 3
  53. -- text size: 12
  54. -- style flags: 0
  55. -- line height: 16
  56. -- part name: 
  57.  
  58.  
  59. -- part 16 (field)
  60. -- low flags: 02
  61. -- high flags: 0002
  62. -- rect: left=76 top=43 right=63 bottom=500
  63. -- title width / last selected line: 0
  64. -- icon id / first selected line: 0 / 0
  65. -- text alignment: 0
  66. -- font id: 3
  67. -- text size: 12
  68. -- style flags: 0
  69. -- line height: 16
  70. -- part name: Self Name
  71. ----- HyperTalk script -----
  72. on closeField
  73.   -- send field updates to children
  74.   if hilite of background button "Debug" is false then lock screen
  75.   if field "Child IDs" is not empty then
  76.     set cursor to watch
  77.     put 1 into childPoint
  78.     put field "Child Stack Name" into childStackName
  79.     put field "Self Name" into selfName
  80.     repeat for the number of lines in field "Child IDs"
  81.       put line childPoint of field "Child IDs" into childID
  82.       push card
  83.       go to card ID childID of stack childStackName
  84.       put empty into field "Parent Name"
  85.       put selfName into field "Parent Name"
  86.       pop card
  87.       add 1 to childPoint
  88.     end repeat
  89.   end if
  90.   unlock screen
  91. end closeField
  92.  
  93.  
  94.  
  95. -- part 18 (field)
  96. -- low flags: 01
  97. -- high flags: 0007
  98. -- rect: left=11 top=64 right=194 bottom=74
  99. -- title width / last selected line: 0
  100. -- icon id / first selected line: 0 / 0
  101. -- text alignment: 0
  102. -- font id: 4
  103. -- text size: 12
  104. -- style flags: 0
  105. -- line height: 16
  106. -- part name: Child IDs
  107.  
  108.  
  109. -- part 19 (field)
  110. -- low flags: 01
  111. -- high flags: 0002
  112. -- rect: left=11 top=21 right=42 bottom=58
  113. -- title width / last selected line: 0
  114. -- icon id / first selected line: 0 / 0
  115. -- text alignment: 0
  116. -- font id: 4
  117. -- text size: 12
  118. -- style flags: 0
  119. -- line height: 16
  120. -- part name: Parent ID
  121.  
  122.  
  123. -- part 20 (field)
  124. -- low flags: 03
  125. -- high flags: 0002
  126. -- rect: left=76 top=21 right=42 bottom=500
  127. -- title width / last selected line: 0
  128. -- icon id / first selected line: 0 / 0
  129. -- text alignment: 0
  130. -- font id: 3
  131. -- text size: 12
  132. -- style flags: 0
  133. -- line height: 16
  134. -- part name: Parent Name
  135.  
  136.  
  137. -- part 21 (field)
  138. -- low flags: 03
  139. -- high flags: 0002
  140. -- rect: left=11 top=43 right=63 bottom=58
  141. -- title width / last selected line: 0
  142. -- icon id / first selected line: 0 / 0
  143. -- text alignment: 0
  144. -- font id: 4
  145. -- text size: 12
  146. -- style flags: 0
  147. -- line height: 16
  148. -- part name: Self ID
  149.  
  150.  
  151. -- part 22 (button)
  152. -- low flags: 00
  153. -- high flags: 8003
  154. -- rect: left=200 top=315 right=337 bottom=300
  155. -- title width / last selected line: 0
  156. -- icon id / first selected line: 0 / 0
  157. -- text alignment: 1
  158. -- font id: 0
  159. -- text size: 12
  160. -- style flags: 0
  161. -- line height: 16
  162. -- part name: Create Child
  163. ----- HyperTalk script -----
  164. on mouseUp
  165.  
  166.   global childStackName, parentStackName, parentName, parentID, selfName, selfID
  167.  
  168.   set cursor to watch
  169.   if hilite of background button "Debug" is false then lock screen
  170.  
  171.   put short name of this stack into parentStackName
  172.   put field "Self Name" into parentName
  173.   put short ID of this card into parentID
  174.  
  175.   put field "Child Stack Name" into childStackName
  176.   go to stack childStackName
  177.   doMenu "New Card"
  178.  
  179.   unlock screen with scroll up
  180.   select text of field "Self Name"
  181. end mouseUp
  182.  
  183.  
  184.  
  185. -- part 23 (button)
  186. -- low flags: 00
  187. -- high flags: 8003
  188. -- rect: left=304 top=315 right=337 bottom=404
  189. -- title width / last selected line: 0
  190. -- icon id / first selected line: 0 / 0
  191. -- text alignment: 1
  192. -- font id: 0
  193. -- text size: 12
  194. -- style flags: 0
  195. -- line height: 16
  196. -- part name: Delete
  197. ----- HyperTalk script -----
  198. on mouseUp
  199.  
  200.   -- warn
  201.   put the number of lines in field "Child IDs" into numChild
  202.   answer "This card has" && numChild && "children.  Delete?" with "OK" or "Cancel"
  203.   if it is "Cancel" then exit mouseUp
  204.  
  205.   set cursor to watch
  206.   if hilite of background button "Debug" is false then lock screen
  207.  
  208.   deleteCard
  209.  
  210.   unlock screen with barn door close
  211. end mouseUp
  212.  
  213.  
  214. on deleteCard
  215.  
  216.   -- kill the childern
  217.   if field "Child IDs" is not empty then
  218.     repeat until field "Child IDs" is empty
  219.       put last line of field "Child IDs" into childID
  220.       put field "Child Stack Name" into childStackName
  221.       push card
  222.       go to card ID childID of stack childStackName
  223.       send deleteCard to background button "Delete"
  224.       pop card
  225.     end repeat
  226.   end if
  227.  
  228.   -- tell the parent
  229.   if field "Parent ID" is not empty then
  230.     put field "Parent Stack Name" into parentStackName
  231.     put field "Parent ID" into parentID
  232.     put field "Self ID" into selfID
  233.     push card
  234.     go to card ID parentID of stack parentStackName
  235.     find selfID in field "Child IDs"
  236.     delete the foundLine
  237.     pop card
  238.   end if
  239.  
  240.   -- kill self
  241.   doMenu "Delete Card"
  242.  
  243. end deleteCard
  244.  
  245.  
  246.  
  247.  
  248. -- part 27 (button)
  249. -- low flags: 00
  250. -- high flags: 8003
  251. -- rect: left=200 top=291 right=313 bottom=300
  252. -- title width / last selected line: 0
  253. -- icon id / first selected line: 0 / 0
  254. -- text alignment: 1
  255. -- font id: 0
  256. -- text size: 12
  257. -- style flags: 0
  258. -- line height: 16
  259. -- part name: Create Peer
  260. ----- HyperTalk script -----
  261. on mouseUp
  262.  
  263.   global childStackName, parentStackName, parentName, parentID, selfName, selfID
  264.  
  265.   set cursor to watch
  266.   if hilite of background button "Debug" is false then lock screen
  267.  
  268.   put field "Child Stack Name" into childStackName
  269.   put field "Parent Stack Name" into parentStackName
  270.   put field "Parent Name" into parentName
  271.   put field "Parent ID" into parentID
  272.  
  273.   doMenu "New Card"
  274.  
  275.   unlock screen with scroll left
  276.   select text of field "Self Name"
  277. end mouseUp
  278.  
  279.  
  280.  
  281. -- part 30 (button)
  282. -- low flags: 00
  283. -- high flags: 8003
  284. -- rect: left=96 top=291 right=313 bottom=196
  285. -- title width / last selected line: 0
  286. -- icon id / first selected line: 0 / 0
  287. -- text alignment: 1
  288. -- font id: 0
  289. -- text size: 12
  290. -- style flags: 0
  291. -- line height: 16
  292. -- part name: Sort: Parent
  293. ----- HyperTalk script -----
  294. on mouseUp
  295.   sort by field "Parent Name"
  296. end mouseUp
  297.  
  298.  
  299.  
  300. -- part 32 (field)
  301. -- low flags: 02
  302. -- high flags: 0002
  303. -- rect: left=76 top=64 right=84 bottom=500
  304. -- title width / last selected line: 0
  305. -- icon id / first selected line: 0 / 0
  306. -- text alignment: 0
  307. -- font id: 3
  308. -- text size: 12
  309. -- style flags: 0
  310. -- line height: 16
  311. -- part name: Parent Stack Name
  312.  
  313.  
  314. -- part 31 (field)
  315. -- low flags: 02
  316. -- high flags: 0002
  317. -- rect: left=76 top=85 right=105 bottom=500
  318. -- title width / last selected line: 0
  319. -- icon id / first selected line: 0 / 0
  320. -- text alignment: 0
  321. -- font id: 3
  322. -- text size: 12
  323. -- style flags: 0
  324. -- line height: 16
  325. -- part name: Child Stack Name
  326.  
  327.  
  328. -- part 34 (button)
  329. -- low flags: 00
  330. -- high flags: C006
  331. -- rect: left=447 top=313 right=339 bottom=508
  332. -- title width / last selected line: 0
  333. -- icon id / first selected line: 0 / 0
  334. -- text alignment: 1
  335. -- font id: 0
  336. -- text size: 12
  337. -- style flags: 0
  338. -- line height: 16
  339. -- part name: Debug
  340. ----- HyperTalk script -----
  341. on mouseUp
  342.  
  343.   if the hilite of me is true then
  344.     hide field "Parent ID"
  345.     hide field "Self ID"
  346.     hide field "Child IDs"
  347.     hide field "Parent ID"
  348.     hide field "Parent Stack Name"
  349.     hide field "Child Stack Name"
  350.     show field "Data"
  351.     hide menubar
  352.   end if
  353.  
  354.   if the hilite of me is false then
  355.     hide field "Data"
  356.     show field "Parent ID"
  357.     show field "Self ID"
  358.     show field "Child IDs"
  359.     show field "Parent ID"
  360.     show field "Parent Stack Name"
  361.     show field "Child Stack Name"
  362.     show menubar
  363.   end if
  364.  
  365.   set the hilite of me to not (the hilite of me)
  366. end mouseUp
  367.  
  368.  
  369.  
  370. -- part 35 (field)
  371. -- low flags: 80
  372. -- high flags: 0007
  373. -- rect: left=9 top=68 right=280 bottom=500
  374. -- title width / last selected line: 0
  375. -- icon id / first selected line: 0 / 0
  376. -- text alignment: 0
  377. -- font id: 3
  378. -- text size: 12
  379. -- style flags: 0
  380. -- line height: 16
  381. -- part name: Data
  382.  
  383.  
  384. -- part 40 (button)
  385. -- low flags: 00
  386. -- high flags: 8003
  387. -- rect: left=96 top=315 right=337 bottom=196
  388. -- title width / last selected line: 0
  389. -- icon id / first selected line: 0 / 0
  390. -- text alignment: 1
  391. -- font id: 0
  392. -- text size: 12
  393. -- style flags: 0
  394. -- line height: 16
  395. -- part name: Sort: Name
  396. ----- HyperTalk script -----
  397. on mouseUp
  398.   sort by field "Self Name"
  399. end mouseUp
  400.  
  401.  
  402.  
  403. -- part 42 (button)
  404. -- low flags: 00
  405. -- high flags: 0000
  406. -- rect: left=58 top=297 right=325 bottom=88
  407. -- title width / last selected line: 0
  408. -- icon id / first selected line: 27009 / 27009
  409. -- text alignment: 1
  410. -- font id: 0
  411. -- text size: 12
  412. -- style flags: 0
  413. -- line height: 16
  414. -- part name: To Next Peer
  415. ----- HyperTalk script -----
  416. on mouseUp
  417.   visual effect scroll left
  418.   go to next card
  419. end mouseUp
  420.  
  421.  
  422. -- part 43 (button)
  423. -- low flags: 00
  424. -- high flags: 0000
  425. -- rect: left=2 top=297 right=325 bottom=32
  426. -- title width / last selected line: 0
  427. -- icon id / first selected line: 9301 / 9301
  428. -- text alignment: 1
  429. -- font id: 0
  430. -- text size: 12
  431. -- style flags: 0
  432. -- line height: 16
  433. -- part name: To Previous Peer
  434. ----- HyperTalk script -----
  435. on mouseUp
  436.   visual effect scroll right
  437.   go to previous card
  438. end mouseUp
  439.  
  440.  
  441. -- part 45 (button)
  442. -- low flags: 00
  443. -- high flags: 0000
  444. -- rect: left=31 top=281 right=312 bottom=59
  445. -- title width / last selected line: 0
  446. -- icon id / first selected line: 32488 / 32488
  447. -- text alignment: 1
  448. -- font id: 0
  449. -- text size: 12
  450. -- style flags: 0
  451. -- line height: 16
  452. -- part name: To Parent
  453. ----- HyperTalk script -----
  454. on mouseUp
  455.  
  456.   if the commandKey is down then -- force down a level
  457.     put field "Parent Stack Name" into parentStack
  458.     visual effect scroll down
  459.     go to first card in stack parentStack
  460.     exit mouseUp
  461.   end if
  462.  
  463.   if field "Parent ID" is empty then exit mouseUp
  464.   put field "Parent ID" into parentID
  465.   put field "Parent Stack Name" into parentStack
  466.   visual effect scroll down
  467.   go to card id parentID in stack parentStack
  468. end mouseUp
  469.  
  470.  
  471.  
  472. -- part 46 (button)
  473. -- low flags: 00
  474. -- high flags: 0000
  475. -- rect: left=31 top=312 right=342 bottom=59
  476. -- title width / last selected line: 0
  477. -- icon id / first selected line: 2335 / 2335
  478. -- text alignment: 1
  479. -- font id: 0
  480. -- text size: 12
  481. -- style flags: 0
  482. -- line height: 16
  483. -- part name: To Last Child
  484. ----- HyperTalk script -----
  485. on mouseUp
  486.  
  487.   if the commandKey is down then -- force down a level
  488.     put field "Child Stack Name" into childStackName
  489.     visual effect scroll up
  490.     go to first card in stack childStackName
  491.     exit mouseUp
  492.   end if
  493.  
  494.   if field "Child IDs" is not empty then
  495.     put last line of field "Child IDs" into childID
  496.     put field "Child Stack Name" into childStackName
  497.     visual effect scroll up
  498.     go to card id childID in stack childStackName
  499.   end if
  500.  
  501. end mouseUp
  502.  
  503.  
  504.  
  505. -- part 48 (button)
  506. -- low flags: 00
  507. -- high flags: 8003
  508. -- rect: left=304 top=291 right=313 bottom=404
  509. -- title width / last selected line: 0
  510. -- icon id / first selected line: 0 / 0
  511. -- text alignment: 1
  512. -- font id: 0
  513. -- text size: 12
  514. -- style flags: 0
  515. -- line height: 16
  516. -- part name: Terms
  517. ----- HyperTalk script -----
  518. on mouseUp
  519.   if hilite of me is false then
  520.     set hilite of me to true
  521.     show field "Terms"
  522.   else
  523.     set hilite of me to false
  524.     hide field "Terms"
  525.   end if
  526. end mouseUp
  527.  
  528.  
  529.  
  530. -- part 49 (field)
  531. -- low flags: 81
  532. -- high flags: 2004
  533. -- rect: left=76 top=21 right=274 bottom=504
  534. -- title width / last selected line: 0
  535. -- icon id / first selected line: 0 / 0
  536. -- text alignment: 0
  537. -- font id: 3
  538. -- text size: 9
  539. -- style flags: 0
  540. -- line height: 12
  541. -- part name: Terms
  542. ----- HyperTalk script -----
  543. on mouseUp
  544.   set hilite of bkgnd btn "Terms" to false
  545.   hide me
  546. end mouseUp
  547.